/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package br.faesa.acervo.business.ejb;

import br.faesa.acervo.business.ejb.to.AlunoTO;
import br.faesa.acervo.entity.Aluno;
import javax.ejb.EJB;
import javax.ejb.Stateless;

/**
 *
 * @author Eric Rosetti Lessa
 */
@Stateless
public class AlunoService implements AlunoServiceRemote {
    
    @EJB
    private AlunoDAO alunoDAO;
    
    public AlunoTO obterPorMatricula(Long matricula){
        Aluno aluno = this.alunoDAO.findByMatricula(matricula);
        
        AlunoTO alunoTO = null;
        if(aluno != null){
            alunoTO = new AlunoTO();
            alunoTO.setLogin(aluno.getLogin());
            alunoTO.setMatricula(aluno.getMatricula());
            alunoTO.setNome(aluno.getNome());
        }
        
        return alunoTO;
    }
    
}
